home *** CD-ROM | disk | FTP | other *** search
- Program MenuDemo;
-
- { Purpose....... Demonstrates the use of the following units: mouse
- Comments...... None
- Author........ Thayne Breetzke
- Date.......... 31 March 1994 }
-
- Uses
- Crt,
- Mouse;
-
- Const
- Options: Array[1..8,1..4] of Word =
- ((8,0,0,0),
- (25,56,0,0),
- (89,120,0,0),
- (153,176,0,0),
- (209,264,0,0),
- (297,352,0,0),
- (385,424,0,0),
- (457,544,0,0));
-
- Var
- Button: Byte;
- Index: Word;
-
- Begin
- ClrScr;
- If not MInstalled then
- Writeln('Sorry, you need a mouse to run this demo...')
- else
- Begin
- Writeln(' File Edit Run Compile Options Debug Break/watch');
- GotoXY(12,10);
- Writeln('╔════════════════════════════════════════════════════╗');
- GotoXY(12,11);
- Writeln('║ Select an option by pressing the left mouse button ║');
- GotoXY(12,12);
- Writeln('╚════════════════════════════════════════════════════╝');
- GotoXY(1,1);
- ShowMouse;
- Repeat
- Button := ButtonPressed;
- Index := MouseLocate(Options)
- until (Button = 1) and (Index in [1..7]);
- HideMouse;
- ClrScr;
- Write('You selected option ',Index,' (');
- Case Index of
- 1: Writeln('File)');
- 2: Writeln('Edit)');
- 3: Writeln('Run)');
- 4: Writeln('Compile)');
- 5: Writeln('Options)');
- 6: Writeln('Debug)');
- 7: Writeln('Break\watch)')
- end
- end
- end.